<template>
  <div class="main-container">
    <h1>这个是父组件</h1>
    <div class="b-container">
      <B></B>
    </div>
    <div class="c-container">
      <C></C>
    </div>

  </div>
</template>
<script>
import B from '../components/learnEventBus/B';
import C from '../components/learnEventBus/C';
import eventBus from '@/util/eventBus.js';

export default {
  data() {
    return {
      // eventBus: eventBus,
      testData: '1'
    }
  },
  beforeCreated() {

  },
  created() {
    eventBus.on(eventBus.TYPES.EVENT1.ADD.CONFIRM, (data) => {
      console.log(data);
    })
  },
  mounted() {
  },
  components: {
    B,
    C,
  },
  beforeDestroy() {
    eventBus.off(eventBus.TYPES.EVENT1.ADD.CONFIRM);
  }
}
</script>

<style lang="scss">
@import 'src/assets/styles/global';

.main-container {
  //@include center
  /*border: ;*/
  margin: 0 100px;
  border: 1px solid red;

}

.b-container {
  /*width: 80px;*/
  /*height: 80px;*/
}

.c-container {
  /*width: 80px;*/
  /*height: 80px;*/
}
</style>
